package com.lehecai.core.search.api;

import net.sf.json.JSON;
import net.sf.json.JSONObject;

public class SearchApiRequestAggregateItem {

    private String operation;
    private String target;
    private String as;

    public SearchApiRequestAggregateItem() {

    }

    public SearchApiRequestAggregateItem(String operation, String target, String as) {
        this.operation = operation;
        this.target = target;
        this.as = as;
    }

	public JSON toJSON() {
        JSONObject aggregateItemObject = new JSONObject();
        aggregateItemObject.put(SearchApiConstant.API_PARAMETER_AGGREGATE_OPERATION, this.operation);
        aggregateItemObject.put(SearchApiConstant.API_PARAMETER_AGGREGATE_TARGET, this.target);
        aggregateItemObject.put(SearchApiConstant.API_PARAMETER_AGGREGATE_AS, this.as);


        return aggregateItemObject;
    }

    public String getOperation() {
        return operation;
    }

    public void setOperation(String operation) {
        this.operation = operation;
    }

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    public String getAs() {
        return as;
    }

    public void setAs(String as) {
        this.as = as;
    }
}
